package jdbc;


import java.io.IOException;
import java.sql.*;
public class JdbcTest {
	private static final String user="root"; 
	private static final String password="123456"; 
	private static final String url="jdbc:mysql://localhost:3306/book?useSSL=false";
	public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
		Class.forName("com.mysql.jdbc.Driver");
		Connection conn=DriverManager.getConnection(url, user, password);
		Statement stat=conn.createStatement();
		String sql2="select * from house where 1=1";
		ResultSet rs=stat.executeQuery(sql2);
		while(rs.next()){
		System.out.println(rs.getInt("id"));
		System.out.println(rs.getString("name"));
		System.out.println(rs.getInt("age"));
		}
		rs.close();
		stat.close();
		conn.close();
		
	}
	

}
